// es6用 class关键字

class Animal{
    constructor(name){
        this.name=name;
    }
    sayHi(){
        console.log(`${this.name}打招呼`);
    }
}

class Dog extends Animal{
    constructor(name,type){
        super(name);
        this.type=type;
    } 
    sayHi(){
        console.log(`${this.name}汪汪汪`);
    }
}
// js class extends super 只是语法糖 ，归根还是原型式面向对象
const dog=new Dog('大毛','labulado');
console.log(dog);
// dog.sayHi();

// console.log(dog.__proto__);
console.log(dog instanceof Animal);